/**
 * Copyright (c) 2017 hadlinks, All Rights Reserved.
 */
package com.bugull.farm.core.control;

import com.bugull.farm.core.enums.BuguEventEnum;

import java.util.EventObject;

/**
 * Project Name: bugu-farm-household
 * Package Name: com.bugull.farm.core.example
 * ClassName: AbstractBuguEvent 
 * Function: TODO ADD FUNCTION.  
 * date: 2017/10/27 21:43
 * @author songwei (songw@hadlinks.com)
 * @since JDK 1.8 
 */
public class AbstractBuguEvent extends EventObject {

    private static final long serialVersionUID = -8714250069783047603L;

    protected BuguEventEnum type;//事件类型，类型同类参见BuguEventEnum的实例对象

    protected boolean success;//事件成功标志

    protected Throwable cause;//异常信息

    /**
     * Constructs a prototypical Event.
     *
     * @param source The object on which the Event initially occurred.
     * @throws IllegalArgumentException if source is null.
     */
    public AbstractBuguEvent(Object source) {
        super(source);
    }

    public BuguEventEnum getType() {
        return type;
    }

    public void setType(BuguEventEnum type) {
        this.type = type;
    }

    public Throwable getCause() {
        return cause;
    }

    public void setCause(Throwable cause) {
        this.cause = cause;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }
}
